package com.borrower.action;

import com.borrower.service.BorrowerServiceImpl;
import com.pojo.BorrowerBean;
import com.utils.EncryptUtils;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

//判断注册时用户名是否存在
public class RegisNameAction extends Action{
    @Override
    public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PrintWriter out = response.getWriter();
        String userName = request.getParameter("userName");

        BorrowerBean bor = new BorrowerBean();

        bor.setUserName(userName);

        BorrowerServiceImpl service = new BorrowerServiceImpl();
        if (service.RegisName(bor)){
            out.print("用户名已存在");
        }

    }
}
